using AutoMapper;
using MapperLearing.mapper_auto.dto;

namespace MapperLearing.mapper_auto
{
    public class MappingProfile : Profile
    {
        public MappingProfile()
        {
            CreateMap<Person, PersonDto>().ForMember(it=>it.Address,e=>e.MapFrom(p=>p.Address.Province + p.Address.City + p.Address.Street));
            CreateMap<PersonDto, Person>().ForMember(it=>it.Address,it=>it.Ignore());
        }
    }
}